package com.leador.assist;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

import com.leador.manger.LBSTraceClient;

/**
 * Created by lhy on 2016/9/13.
 */
public class LBSClientHandler extends Handler {
    @Override
    public void handleMessage(Message msg) {
        super.handleMessage(msg);
        switch (msg.what){
            case 20:
                if(LBSTraceClient.onStartTraceListener!=null){
                    LBSTraceClient.onStartTraceListener.onTraceCallback(10008,"开启缓存");
                }
                break;
            case 21:
                if(LBSTraceClient.onStartTraceListener!=null){
                    LBSTraceClient.onStartTraceListener.onTraceCallback(10009,"已开启缓存");
                }
                break;
            case 22:
                if(LBSTraceClient.onStartTraceListener!=null){
                    LBSTraceClient.onStartTraceListener.onTraceCallback(10005, "服务正在开启");
                }
                break;
            case 25:
                if(LBSTraceClient.onStartTraceListener!=null){
                    LBSTraceClient.onStartTraceListener.onTraceCallback(10006,"服务已开启");
                }
                break;
            case 27:
                if (LBSTraceClient.onStopTraceListener!= null) {
                    LBSTraceClient.onStopTraceListener.onStopTraceFailed(11002, "服务未开启");
                    return;
                }
                break;
            case 28:
                if (LBSTraceClient.onStopTraceListener != null) {
                    LBSTraceClient.onStopTraceListener.onStopTraceFailed(11003, "服务正在停止");
                    return;
                }
                break;
            case 29:
                if (LBSTraceClient.onStopTraceListener != null) {
                    LBSTraceClient.onStopTraceListener.onStopTraceSuccess();
                    return;
                }
                break;
        }
    }
}
